package com.gollum.jpa.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 * 顶级BaseEntity
 *
 * @author Herther
 * @version 1.0.0
 * @ClassName SupperBaseEntity.java
 * @createTime 2022年07月14日 00:20:00
 */
@MappedSuperclass
public class SuperBaseEntity {

    /**
     * 创建者
     */
    @Column(name = "create_by")
    @CreatedBy
    protected String createBy;

    /**
     * 更新者
     */
    @Column(name = "modify_by")
    @LastModifiedBy
    protected String modifyBy;

    /**
     * 创建时间
     */
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time")
    @CreatedDate
    protected Date createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @LastModifiedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "modify_time")
    protected Date modifyTime;

    /** 是否删除 1删除 0正常 **/
    @Column(name = "HAS_DEL")
    protected String hasDel;

    //
    ///** 版本号 **/
    //@Column(name = "clientCode")
    //protected Long clientCode;

    /**
     * 备注
     */
    @Column(name = "remark")
    protected String remark;


    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getModifyBy() {
        return modifyBy;
    }

    public void setModifyBy(String modifyBy) {
        this.modifyBy = modifyBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getHasDel() {
        return hasDel;
    }

    public void setHasDel(String hasDel) {
        this.hasDel = hasDel;
    }

    //public Long getClientCode() {
    //    return clientCode;
    //}
    //
    //public void setClientCode(Long clientCode) {
    //    this.clientCode = clientCode;
    //}

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
